#include "changerobotdialog.h"
#include "ui_changerobotdialog.h"

ChangeRobotDialog::ChangeRobotDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::ChangeRobotDialog)
{
    ui->setupUi(this);

    robotID = 1;

    this->setWindowFlags(Qt::FramelessWindowHint);    //无边框
    this->setStyleSheet("outline: none;");            //无虚线框
}

ChangeRobotDialog::~ChangeRobotDialog()
{
    delete ui;
}

void ChangeRobotDialog::changeRobotID(int id)
{
    robotID = id;
    ui->message->setText(tr("是否切换到 ") + QString::number(robotID) + tr("号 机器人"));
}

void ChangeRobotDialog::changeLanguage()
{
    ui->retranslateUi(this);
}

void ChangeRobotDialog::on_sureBtn_clicked()
{
    emit changeRobotSiganl(robotID);
    this->hide();
}

void ChangeRobotDialog::on_cancelBtn_clicked()
{
    this->hide();
}
